package com.springboot.web.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@ApiModel(description="用户实体")
@AllArgsConstructor
@NoArgsConstructor
public class User {

    @ApiModelProperty("用户编号")
    @NotNull
    private Long id;

    @ApiModelProperty("用户姓名")
    @NotEmpty
    private String name;

    @ApiModelProperty("用户年龄")
    @Min(value = 0,message = "年龄不能低于0岁")
    @Max(value = 150,message = "年龄不能大于150岁")
    private Integer age;

}